diff --git a/user_guide/scripts/hacks.txt b/user_guide/scripts/hacks.txt
new file mode 100644
index 0000000..f29e5a7
--- /dev/null
+++ b/user_guide/scripts/hacks.txt
@@ -0,0 +1,9 @@
+I did the following hack in moo.fx.js:
+
+At line 79 in the toggle: function()  function, I added:
+
+document.getElementById('nav').style.display = 'block';
+
+
+
+-- Rick Ellis
\ No newline at end of file
diff --git a/user_guide/scripts/moo.fx.js b/user_guide/scripts/moo.fx.js
new file mode 100755
index 0000000..953e87c
--- /dev/null
+++ b/user_guide/scripts/moo.fx.js
@@ -0,0 +1,119 @@
+/*
+moo.fx, simple effects library built with prototype.js (http://prototype.conio.net).
+by Valerio Proietti (http://mad4milk.net) MIT-style LICENSE.
+for more info (http://moofx.mad4milk.net).
+10/24/2005
+v(1.0.2)
+*/
+
+//base
+var fx = new Object();
+fx.Base = function(){};
+fx.Base.prototype = {
+	setOptions: function(options) {
+	this.options = {
+		duration: 500,
+		onComplete: ''
+	}
+	Object.extend(this.options, options || {});
+	},
+
+	go: function() {
+		this.duration = this.options.duration;
+		this.startTime = (new Date).getTime();
+		this.timer = setInterval (this.step.bind(this), 13);
+	},
+
+	step: function() {
+		var time  = (new Date).getTime();
+		var Tpos   = (time - this.startTime) / (this.duration);
+		if (time >= this.duration+this.startTime) {
+			this.now = this.to;
+			clearInterval (this.timer);
+			this.timer = null;
+			if (this.options.onComplete) setTimeout(this.options.onComplete.bind(this), 10);
+		}
+		else {
+			this.now = ((-Math.cos(Tpos*Math.PI)/2) + 0.5) * (this.to-this.from) + this.from;
+			//this time-position, sinoidal transition thing is from script.aculo.us
+		}
+		this.increase();
+	},
+
+	custom: function(from, to) {
+		if (this.timer != null) return;
+		this.from = from;
+		this.to = to;
+		this.go();
+	},
+
+	hide: function() {
+		this.now = 0;
+		this.increase();
+	},
+
+	clearTimer: function() {
+		clearInterval(this.timer);
+		this.timer = null;
+	}
+}
+
+//stretchers
+fx.Layout = Class.create();
+fx.Layout.prototype = Object.extend(new fx.Base(), {
+	initialize: function(el, options) {
+		this.el = $(el);
+		this.el.style.overflow = "hidden";
+		this.el.iniWidth = this.el.offsetWidth;
+		this.el.iniHeight = this.el.offsetHeight;
+		this.setOptions(options);
+	}
+});
+
+fx.Height = Class.create();
+Object.extend(Object.extend(fx.Height.prototype, fx.Layout.prototype), {	
+	increase: function() {
+		this.el.style.height = this.now + "px";
+	},
+
+	toggle: function() {
+		if (this.el.offsetHeight > 0) this.custom(this.el.offsetHeight, 0);
+		else this.custom(0, this.el.scrollHeight);
+	}
+});
+
+fx.Width = Class.create();
+Object.extend(Object.extend(fx.Width.prototype, fx.Layout.prototype), {	
+	increase: function() {
+		this.el.style.width = this.now + "px";
+	},
+
+	toggle: function(){
+		if (this.el.offsetWidth > 0) this.custom(this.el.offsetWidth, 0);
+		else this.custom(0, this.el.iniWidth);
+	}
+});
+
+//fader
+fx.Opacity = Class.create();
+fx.Opacity.prototype = Object.extend(new fx.Base(), {
+	initialize: function(el, options) {
+		this.el = $(el);
+		this.now = 1;
+		this.increase();
+		this.setOptions(options);
+	},
+
+	increase: function() {
+		if (this.now == 1) this.now = 0.9999;
+		if (this.now > 0 && this.el.style.visibility == "hidden") this.el.style.visibility = "visible";
+		if (this.now == 0) this.el.style.visibility = "hidden";
+		if (window.ActiveXObject) this.el.style.filter = "alpha(opacity=" + this.now*100 + ")";
+		this.el.style.opacity = this.now;
+	},
+
+	toggle: function() {
+		if (this.now > 0) this.custom(1, 0);
+		else this.custom(0, 1);
+	}
+});
\ No newline at end of file
diff --git a/user_guide/scripts/moo.fx.pack.js b/user_guide/scripts/moo.fx.pack.js
new file mode 100755
index 0000000..8b42283
--- /dev/null
+++ b/user_guide/scripts/moo.fx.pack.js
@@ -0,0 +1,241 @@
+/*
+moo.fx pack, effects extensions for moo.fx.
+by Valerio Proietti (http://mad4milk.net) MIT-style LICENSE
+for more info visit (http://moofx.mad4milk.net).
+Wednesday, November 16, 2005
+v1.0.4
+*/
+
+//text size modify, now works with pixels too.
+fx.Text = Class.create();
+fx.Text.prototype = Object.extend(new fx.Base(), {
+	initialize: function(el, options) {
+		this.el = $(el);
+		this.setOptions(options);
+		if (!this.options.unit) this.options.unit = "em";
+	},
+
+	increase: function() {
+		this.el.style.fontSize = this.now + this.options.unit;
+	}
+});
+
+//composition effect, calls Width and Height alltogheter
+fx.Resize = Class.create();
+fx.Resize.prototype = {
+	initialize: function(el, options) {
+		this.h = new fx.Height(el, options); 
+		if (options) options.onComplete = null;
+		this.w = new fx.Width(el, options);
+		this.el = $(el);
+	},
+
+	toggle: function(){
+		this.h.toggle();
+		this.w.toggle();
+	},
+
+	modify: function(hto, wto) {
+		this.h.custom(this.el.offsetHeight, this.el.offsetHeight + hto);
+		this.w.custom(this.el.offsetWidth, this.el.offsetWidth + wto);
+	},
+
+	custom: function(hto, wto) {
+		this.h.custom(this.el.offsetHeight, hto);
+		this.w.custom(this.el.offsetWidth, wto);
+	},
+
+	hide: function(){
+		this.h.hide();
+		this.w.hide();
+	}
+}
+
+//composition effect, calls Opacity and (Width and/or Height) alltogheter
+fx.FadeSize = Class.create();
+fx.FadeSize.prototype = {
+	initialize: function(el, options) {
+		this.el = $(el);
+		this.el.o = new fx.Opacity(el, options);
+		if (options) options.onComplete = null;
+		this.el.h = new fx.Height(el, options);
+		this.el.w = new fx.Width(el, options);
+	},
+
+	toggle: function() {
+		this.el.o.toggle();
+		for (var i = 0; i < arguments.length; i++) {
+			if (arguments[i] == 'height') this.el.h.toggle();
+			if (arguments[i] == 'width') this.el.w.toggle();
+		}
+	},
+
+	hide: function(){
+		this.el.o.hide();
+		for (var i = 0; i < arguments.length; i++) {
+			if (arguments[i] == 'height') this.el.h.hide();
+			if (arguments[i] == 'width') this.el.w.hide();
+		}
+	}
+}
+
+//intended to work with arrays.
+var Multi = new Object();
+Multi = function(){};
+Multi.prototype = {
+	initialize: function(elements, options){
+		this.options = options;
+		this.el = this.getElementsFromArray(elements);
+		for (i=0;i<this.el.length;i++){
+			this.effect(this.el[i]);
+		}
+	},
+
+	getElementsFromArray: function(array) {
+		var elements = new Array();
+		for (i=0;i<array.length;i++) { 
+			elements.push($(array[i])); 
+		}
+		return elements;
+	}
+}
+
+//Fadesize with arrays
+fx.MultiFadeSize = Class.create();
+fx.MultiFadeSize.prototype = Object.extend(new Multi(), {
+	effect: function(el){
+		el.fs = new fx.FadeSize(el, this.options);
+	},
+
+	showThisHideOpen: function(el, delay, mode){
+		for (i=0;i<this.el.length;i++){
+			if (this.el[i].offsetHeight > 0 && this.el[i] != el && this.el[i].h.timer == null && el.h.timer == null){
+				this.el[i].fs.toggle(mode);
+				setTimeout(function(){el.fs.toggle(mode);}.bind(el), delay);
+			}
+			
+		}
+	},
+
+	hide: function(el, mode){
+		el.fs.hide(mode);
+	}
+});
+
+var Remember = new Object();
+Remember = function(){};
+Remember.prototype = {
+	initialize: function(el, options){
+		this.el = $(el);
+		this.days = 365;
+		this.options = options;
+		this.effect();
+		var cookie = this.readCookie();
+		if (cookie) {
+			this.fx.now = cookie;
+			this.fx.increase();
+		}
+	},
+
+	//cookie functions based on code by Peter-Paul Koch
+	setCookie: function(value) {
+		var date = new Date();
+		date.setTime(date.getTime()+(this.days*24*60*60*1000));
+		var expires = "; expires="+date.toGMTString();
+		document.cookie = this.el+this.el.id+this.prefix+"="+value+expires+"; path=/";
+	},
+
+	readCookie: function() {
+		var nameEQ = this.el+this.el.id+this.prefix + "=";
+		var ca = document.cookie.split(';');
+		for(var i=0;i < ca.length;i++) {
+			var c = ca[i];
+			while (c.charAt(0)==' ') c = c.substring(1,c.length);
+			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
+		}
+		return false;
+	},
+
+	custom: function(from, to){
+		if (this.fx.now != to) {
+			this.setCookie(to);
+			this.fx.custom(from, to);
+		}
+	}
+}
+
+fx.RememberHeight = Class.create();
+fx.RememberHeight.prototype = Object.extend(new Remember(), {
+	effect: function(){
+		this.fx = new fx.Height(this.el, this.options);
+		this.prefix = 'height';
+	},
+	
+	toggle: function(){
+		if (this.el.offsetHeight == 0) this.setCookie(this.el.scrollHeight);
+		else this.setCookie(0);
+		this.fx.toggle();
+	},
+	
+	resize: function(to){
+		this.setCookie(this.el.offsetHeight+to);
+		this.fx.custom(this.el.offsetHeight,this.el.offsetHeight+to);
+	},
+
+	hide: function(){
+		if (!this.readCookie()) {
+			this.fx.hide();
+		}
+	}
+});
+
+fx.RememberText = Class.create();
+fx.RememberText.prototype = Object.extend(new Remember(), {
+	effect: function(){
+		this.fx = new fx.Text(this.el, this.options);
+		this.prefix = 'text';
+	}
+});
+
+
+//use to attach effects without using js code, just classnames and rel attributes.
+ParseClassNames = Class.create();
+ParseClassNames.prototype = {
+	initialize: function(options){
+		var babies = document.getElementsByTagName('*') || document.all;
+		for (var i = 0; i < babies.length; i++) {
+			var el = babies[i];
+			//attach the effect, from the classNames;
+			var effects = this.getEffects(el);
+			for (var j = 0; j < effects.length; j++) {
+				if (j == 1 && options) options.onComplete = null;
+				el[effects[j]+"fx"] = new fx[effects[j]](el, options);
+			}
+			//execute methods, from rel
+			if (el.rel) {
+				el.crel = el.rel.split(' ');
+				if (el.crel[0].indexOf("fx_") > -1) {
+					var event = el.crel[0].replace('fx_', '');
+					var tocompute = this.getEffects($(el.crel[1]));
+					el["on"+event] = function(){
+						for (var f = 0; f < tocompute.length; f++) {
+							$(this.crel[1])[tocompute[f]+"fx"][this.crel[2] || "toggle"](this.crel[3] || null, this.crel[4] || null);
+						}
+					}
+				}
+			}
+		}
+	},
+
+	getEffects: function(el){
+		var effects = new Array();
+		var css = el.className.split(' ');
+		for (var i = 0; i < css.length; i++) {
+			if (css[i].indexOf('fx_') > -1) {
+				var effect = css[i].replace('fx_', '');
+				effects.push(effect);
+			}
+		}
+		return effects;
+	}
+}
\ No newline at end of file
diff --git a/user_guide/scripts/nav.js b/user_guide/scripts/nav.js
new file mode 100644
index 0000000..be0f7b1
--- /dev/null
+++ b/user_guide/scripts/nav.js
@@ -0,0 +1,116 @@
+function create_menu(basepath)
+{
+	var base = (basepath == 'null') ? '' : basepath;
+
+	document.write(
+		'<table cellpadding="0" cellspaceing="0" border="0" style="width:98%"><tr>' +
+		'<td class="td" valign="top">' +
+
+		'<p><a href="'+base+'index.html">User Guide Home</a></p>' +	
+
+		'<h3>Basic Info</h3>' +
+		'<ul>' +
+			'<li><a href="'+base+'general/requirements.html">Server Requirements</a></li>' +
+			'<li><a href="'+base+'license.html">License Agreement</a></li>' +
+			'<li><a href="'+base+'general/changelog.html">Change Log</a></li>' +
+			'<li><a href="'+base+'general/credits.html">Credits</a></li>' +
+		'</ul>' +	
+		
+		'<h3>Installation</h3>' +
+		'<ul>' +
+			'<li><a href="'+base+'installation/downloads.html">Downloading Code Igniter</a></li>' +
+			'<li><a href="'+base+'installation/index.html">Installation Instructions</a></li>' +
+			'<li><a href="'+base+'installation/upgrading.html">Upgrading from a Previous Version</a></li>' +
+		'</ul>' +
+		
+		'<h3>Introduction</h3>' +
+		'<ul>' +
+			'<li><a href="'+base+'overview/at_a_glance.html">Code Igniter at a Glance</a></li>' +
+			'<li><a href="'+base+'overview/features.html">Supported Features</a></li>' +
+			'<li><a href="'+base+'overview/appflow.html">Application Flow Chart</a></li>' +
+			'<li><a href="'+base+'overview/mvc.html">Model-View-Controller</a></li>' +
+			'<li><a href="'+base+'overview/goals.html">Architectural Goals</a></li>' +
+		'</ul>' +	
+				
+		'</td><td class="td_sep" valign="top">' +
+
+		'<h3>General Topics</h3>' +
+		'<ul>' +
+			'<li><a href="'+base+'general/index.html">Getting Started</a></li>' +
+			'<li><a href="'+base+'general/urls.html">Code Igniter URLs</a></li>' +
+			'<li><a href="'+base+'general/controllers.html">Controllers</a></li>' +
+			'<li><a href="'+base+'general/views.html">Views</a></li>' +
+			'<li><a href="'+base+'general/models.html">Models</a></li>' +
+			'<li><a href="'+base+'general/helpers.html">Helpers</a></li>' +
+			'<li><a href="'+base+'general/plugins.html">Plugins</a></li>' +
+			'<li><a href="'+base+'general/scripts.html">Scripts</a></li>' +
+			'<li><a href="'+base+'general/libraries.html">Using Code Igniter Libraries</a></li>' +
+			'<li><a href="'+base+'general/creating_libraries.html">Creating Your Own Libraries</a></li>' +
+			'<li><a href="'+base+'general/base_classes.html">Creating Core Classes</a></li>' +
+			'<li><a href="'+base+'general/hooks.html">Hooks - Extending the Core</a></li>' +
+			'<li><a href="'+base+'general/autoloader.html">Auto-loading Resources</a></li>' +
+			'<li><a href="'+base+'general/scaffolding.html">Scaffolding</a></li>' +
+			'<li><a href="'+base+'general/routing.html">URI Routing</a></li>' +
+			'<li><a href="'+base+'general/errors.html">Error Handling</a></li>' +
+			'<li><a href="'+base+'general/caching.html">Web Page Caching</a></li>' +
+			'<li><a href="'+base+'general/multiple_apps.html">Running Multiple Applications</a></li>' +
+			'<li><a href="'+base+'general/alternative_php.html">Alternative PHP Syntax</a></li>' +
+			'<li><a href="'+base+'general/security.html">Security</a></li>' +
+		'</ul>' +
+		
+		'</td><td class="td_sep" valign="top">' +
+
+				
+		'<h3>Class Reference</h3>' +
+		'<ul>' +
+		'<li><a href="'+base+'libraries/benchmark.html">Benchmarking Class</a></li>' +
+		'<li><a href="'+base+'libraries/calendar.html">Calendaring Class</a></li>' +
+		'<li><a href="'+base+'libraries/config.html">Config Class</a></li>' +
+		'<li><a href="'+base+'libraries/database/index.html">Database Class</a></li>' +
+		'<li><a href="'+base+'libraries/email.html">Email Class</a></li>' +
+		'<li><a href="'+base+'libraries/encryption.html">Encryption Class</a></li>' +
+		'<li><a href="'+base+'libraries/file_uploading.html">File Uploading Class</a></li>' +
+		'<li><a href="'+base+'libraries/image_lib.html">Image Manipulation Class</a></li>' +		
+		'<li><a href="'+base+'libraries/input.html">Input and Security Class</a></li>' +
+		'<li><a href="'+base+'libraries/loader.html">Loader Class</a></li>' +
+		'<li><a href="'+base+'libraries/language.html">Language Class</a></li>' +
+		'<li><a href="'+base+'libraries/output.html">Output Class</a></li>' +
+		'<li><a href="'+base+'libraries/pagination.html">Pagination Class</a></li>' +
+		'<li><a href="'+base+'libraries/sessions.html">Session Class</a></li>' +
+		'<li><a href="'+base+'libraries/trackback.html">Trackback Class</a></li>' +
+		'<li><a href="'+base+'libraries/parser.html">Template Parser Class</a></li>' +
+		'<li><a href="'+base+'libraries/unit_testing.html">Unit Testing Class</a></li>' +
+		'<li><a href="'+base+'libraries/uri.html">URI Class</a></li>' +
+		'<li><a href="'+base+'libraries/validation.html">Validation Class</a></li>' +
+		'<li><a href="'+base+'libraries/xmlrpc.html">XML-RPC Class</a></li>' +
+		'</ul>' +
+
+		'</td><td class="td_sep" valign="top">' +
+
+		'<h3>Helper Reference</h3>' +
+		'<ul>' +
+		'<li><a href="'+base+'helpers/array_helper.html">Array Helper</a></li>' +
+		'<li><a href="'+base+'helpers/cookie_helper.html">Cookie Helper</a></li>' +
+		'<li><a href="'+base+'helpers/date_helper.html">Date Helper</a></li>' +
+		'<li><a href="'+base+'helpers/directory_helper.html">Directory Helper</a></li>' +
+		'<li><a href="'+base+'helpers/file_helper.html">File Helper</a></li>' +
+		'<li><a href="'+base+'helpers/form_helper.html">Form Helper</a></li>' +
+		'<li><a href="'+base+'helpers/html_helper.html">HTML Helper</a></li>' +
+		'<li><a href="'+base+'helpers/security_helper.html">Security Helper</a></li>' +
+		'<li><a href="'+base+'helpers/string_helper.html">String Helper</a></li>' +
+		'<li><a href="'+base+'helpers/text_helper.html">Text Helper</a></li>' +
+		'<li><a href="'+base+'helpers/typography_helper.html">Typography Helper</a></li>' +
+		'<li><a href="'+base+'helpers/url_helper.html">URL Helper</a></li>' +
+		'<li><a href="'+base+'helpers/xml_helper.html">XML Helper</a></li>' +
+		'</ul>' +	
+
+
+		'<h3>Additional Resources</h3>' +
+		'<ul>' +
+		'<li><a href="'+base+'general/quick_reference.html">Quick Reference Chart</a></li>' +
+		'<li><a href="http://www.codeigniter.com/forums/">Community Forums</a></li>' +
+		'<li><a href="http://www.codeigniter.com/wiki/">Community Wiki</a></li>' +
+		'</ul>' +	
+		
+		'</td></tr></table>');
+}
\ No newline at end of file
diff --git a/user_guide/scripts/prototype.lite.js b/user_guide/scripts/prototype.lite.js
new file mode 100755
index 0000000..f1520e2
--- /dev/null
+++ b/user_guide/scripts/prototype.lite.js
@@ -0,0 +1,127 @@
+/*  Prototype JavaScript framework
+ *  (c) 2005 Sam Stephenson <sam@conio.net>
+ *
+ *  Prototype is freely distributable under the terms of an MIT-style license.
+ *
+ *  For details, see the Prototype web site: http://prototype.conio.net/
+ *
+/*--------------------------------------------------------------------------*/
+
+
+//note: this is a stripped down version of prototype, to be used with moo.fx by mad4milk (http://moofx.mad4milk.net).
+
+var Class = {
+  create: function() {
+    return function() { 
+      this.initialize.apply(this, arguments);
+    }
+  }
+}
+
+Object.extend = function(destination, source) {
+  for (property in source) {
+    destination[property] = source[property];
+  }
+  return destination;
+}
+
+Function.prototype.bind = function(object) {
+  var __method = this;
+  return function() {
+    return __method.apply(object, arguments);
+  }
+}
+
+function $() {
+  var elements = new Array();
+
+  for (var i = 0; i < arguments.length; i++) {
+    var element = arguments[i];
+    if (typeof element == 'string')
+      element = document.getElementById(element);
+
+    if (arguments.length == 1) 
+      return element;
+
+    elements.push(element);
+  }
+
+  return elements;
+}
+
+//-------------------------
+
+document.getElementsByClassName = function(className) {
+  var children = document.getElementsByTagName('*') || document.all;
+  var elements = new Array();
+  
+  for (var i = 0; i < children.length; i++) {
+    var child = children[i];
+    var classNames = child.className.split(' ');
+    for (var j = 0; j < classNames.length; j++) {
+      if (classNames[j] == className) {
+        elements.push(child);
+        break;
+      }
+    }
+  }
+  
+  return elements;
+}
+
+//-------------------------
+
+if (!window.Element) {
+  var Element = new Object();
+}
+
+Object.extend(Element, {
+  remove: function(element) {
+    element = $(element);
+    element.parentNode.removeChild(element);
+  },
+
+  hasClassName: function(element, className) {
+    element = $(element);
+    if (!element)
+      return;
+    var a = element.className.split(' ');
+    for (var i = 0; i < a.length; i++) {
+      if (a[i] == className)
+        return true;
+    }
+    return false;
+  },
+
+  addClassName: function(element, className) {
+    element = $(element);
+    Element.removeClassName(element, className);
+    element.className += ' ' + className;
+  },
+  
+  removeClassName: function(element, className) {
+    element = $(element);
+    if (!element)
+      return;
+    var newClassName = '';
+    var a = element.className.split(' ');
+    for (var i = 0; i < a.length; i++) {
+      if (a[i] != className) {
+        if (i > 0)
+          newClassName += ' ';
+        newClassName += a[i];
+      }
+    }
+    element.className = newClassName;
+  },
+  
+  // removes whitespace-only text node children
+  cleanWhitespace: function(element) {
+    element = $(element);
+    for (var i = 0; i < element.childNodes.length; i++) {
+      var node = element.childNodes[i];
+      if (node.nodeType == 3 && !/\S/.test(node.nodeValue)) 
+        Element.remove(node);
+    }
+  }
+});
\ No newline at end of file
